<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    body {
        padding: 50px;
    }
    /* 如果需要更细粒度地控制连字符的行为（比如在简短的引文中），你仍
然可以通过一些软连字符（&shy;）来辅助浏览器进行断词。这个hyphens
属性会优先处理它们，然后再去计算其他可以断词的地方。 */
    
    .mydiv {
        height: 100px;
        width: 100px;
        border: 1px solid #ccc;
        margin-bottom: 20px;
        display: inline-block;
    }
    
    .case1 {
        width: 7em;
        font: 180%/1.4 Baskerville, serif;
        text-align: justify;
        hyphens: auto;
    }
    
    .case2 {}
    
    .case3 {}
</style>

<body>
    <div class="mydiv case1">“The only way to get rid of a temptation is to yield to it.”</div>
    <div class="mydiv case2"></div>
    <div class="mydiv case3"></div>
</body>

</html>